#pragma once

#include <lines/LineDetectorFactory.h>
#include <lines/LinesDemoHelper.h>

#include <cv.h>

#include <string>

/**
 * demo line detector on several sequences
 * generate results
 */
class Demo_LineDetector {
public:
	Demo_LineDetector(void);
	~Demo_LineDetector(void);

public:
	void demo();

private:

	void setUp();
	void tearDown();

	void setInputDirectory(const std::string& dir);
	void setOutputDirectory(const std::string& dir);

	void runLineDetectorOnImages(LineDetector* pLineDetector);

	void process(LineDetector* pLineDetector, const IplImage* src, IplImage* dst);

	void saveLinesImage(const IplImage* im, const char* filename);

private:
	std::string inputDirectory;
	std::string outputDirectory;

	IplImage* dst;

	LineDetectorFactory* pFactory;
	LinesDemoHelper linesDemoHelper;
};
